package com.oo.polymorphic_4.area;

import java.util.Scanner;

/**
 * Triangle--${description}
 *
 * @author: Jovi
 * @createTime: 2017-05-09 16:20
 **/
public class Triangle extends Shape {
    public Triangle() {
    }

    public Triangle(String name) {
        super(name);
    }

    @Override
    public void getArea() {
        System.out.println("请输入三角形的底：");
        Scanner sc = new Scanner(System.in);
        int bottom = sc.nextInt();
        System.out.println("请输入三角形的高：");
        int high = sc.nextInt();
        System.out.println("三角形的面积是："+bottom*high/2);
    }
}
